package com.hobson.design.factory.template;

/**
 * 消息推送处理器模板类
 *
 * @author: haibin.tang
 * @date: 2020/8/13
 */
public abstract class MessagePushHandler {

    protected Message message;

    public MessagePushHandler(Message message) {
        this.message = message;
    }

    public void handle() {
        check();
        push();
        save2db();
    }

    /**
     * 参数校验
     */
    protected abstract void check();

    /**
     * 推送
     */
    protected abstract void push();

    /**
     * 推送记录归档
     */
    protected abstract void save2db();
}
